package com.liit.module.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liit.module.dao.CarouselDao;
import com.liit.module.entity.Carousel;
import com.liit.module.frame.utils.page.Pagination;
import com.liit.module.service.CarouselService;

/**
 * @author dingweibo
 * @Title: CarouselServiceImpl.java
 * @Description: 首页轮播服务实现
 * @date 2015年12月15日
 */
@Service("carouselService")
public class CarouselServiceImpl implements CarouselService {

	@Autowired
	CarouselDao carouseDao;

	@Override
	public Map<String, Object> listPage(Pagination pagination, Carousel record) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("list", carouseDao.listPage(pagination, record));
		result.put("page", pagination);
		return result;
	}

	@Override
	public int insertAndReturnPK(Carousel record) {
		return carouseDao.insert(record);
	}

	@Override
	public int deleteById(Integer id) {
		return carouseDao.deleteById(id);
	}

	@Override
	public Carousel selectById(Integer id) {
		return carouseDao.selectById(id);
	}

	@Override
	public int updateById(Carousel record) {
		return carouseDao.updateById(record);
	}

	@Override
	public int update(Carousel record) {
		return carouseDao.update(record);
	}
}
